#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll T,n,m,a[1111111],c[1111111];
int main()
{
    freopen("arena.in","r",stdin);
    freopen("arena.out","w",stdout);
    cin>>T;
    for(int p=0;p<T;p++){
        cin>>n>>m;
        for(int i=0;i<n;i++)cin>>a[i];
        for(int i=0;i<m;i++)cin>>c[i];
        cout<<1<<endl;
        return 0;
    }
    return 0;
}

